
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
  <link rel="stylesheet" th:href="@{/style/custom.css}" media="all">
</head>
<body>

  <div class="layui-form" lay-filter="task-identity-form-edit" id="task-identity-form-edit" style="padding: 20px 0 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">任务节点</label>
      <div class="layui-input-inline" style="width: 280px;">
        <select name="taskId" lay-filter="select" lay-verify="required">
          <option value="">请选择</option>
          <option th:each="map,idx:${userTasks}" th:value="${map.key}" th:selected="${map.key == taskPosition.taskId}" th:text="${map.value}"></option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">候选岗位</label>
      <div class="layui-input-block" id="postId" style="width: 280px;">
      </div>
    </div>
    <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="LAY-task-identity-front-submit" id="LAY-task-identity-front-submit" value="确认">
    </div>
  </div>

  <script th:src="@{/layui/layui.js}"></script>
  <!-- 获取model返回的值-->
  <script th:inline="javascript">
    let positions = [[${positions}]];
  </script>
  <script th:src="@{/layui/layui.js}"></script>
  <script>
    layui.config({
      base: '/'
    }).extend({
      xmSelect: 'extend/xm-select/dist/xm-select',
      flying: 'flying'
    }).use(['index', 'xmSelect', 'flying'], function() {
      let form = layui.form;
      let admin = layui.admin;
      let xmSelect = layui.xmSelect;
      let flying = layui.flying;

      //岗位
      let position_select = xmSelect.render({
        el: '#postId',
        name: 'postId',
        layVerify: 'required',
        layVerType: 'msg',
        toolbar: {
          show: true,
          list: ['ALL', 'CLEAR', 'REVERSE']
        },
        filterable: true,
        data: []
      });

      flying.load_post_xmSelect(position_select, positions);

    });

  </script>
</body>
</html>